import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { AppComponent } from './app.component';
import { HeaderComponent } from './header.component';
// ‘音乐’模块
import { MusicBarComponent } from './music-bar.component';
import { MusicHotComponent } from './music/music-hot.component';
import { MusicTopListComponent } from './music/music-top-list.component';
import { MusicSongListComponent } from './music/music-song-list.component';
import { MusicRadioComponent } from './music/music-radio.component';
import {MusicHeaderComponent} from './music/music-header.component';
// ‘动态’模块
import {DynamicMainComponent} from './dynamic/dynamic-main.component';
// ‘我的’模块
import {MyMainComponent} from './my/my-main.component';
//‘播放’模块
import {PlayIndexComponent} from './play/play-index.component';

const routes: Routes = [
  { path: '', redirectTo: '/music/hot', pathMatch: 'full' },
  { path: '#/', component: MusicHotComponent },
  { path: 'music', redirectTo: '/music/hot', pathMatch: 'full' },
  { path: 'music', component: MusicHeaderComponent,children:[
      { path: 'hot', component: MusicHotComponent },
      { path: 'top-list', component: MusicTopListComponent },
      { path: 'song-list', component: MusicSongListComponent },
      { path: 'radio', component: MusicRadioComponent },
  ] },

  { path: 'dynamic', component: DynamicMainComponent },
  { path: 'my', component: MyMainComponent },
  { path:'play',component:PlayIndexComponent },

]
@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { routes }
